home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 October: Mac OS SDK / Dev.CD Oct 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Universal / Interfaces / CIncludes / Sound.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-12  |  54.8 KB  |  1,402 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Sound.h
  3.  
  4.      Contains:    Sound Manager Interfaces.
  5.  
  6.      Version:    Technology:    Sound Manager 3.3
  7.                  Release:    Universal Interfaces 3.0.1
  8.  
  9.      Copyright:    © 1986-1997 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. */
  18. #ifndef __SOUND__
  19. #define __SOUND__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __DIALOGS__
  25. #include <Dialogs.h>
  26. #endif
  27. #ifndef __COMPONENTS__
  28. #include <Components.h>
  29. #endif
  30. #ifndef __MIXEDMODE__
  31. #include <MixedMode.h>
  32. #endif
  33. #ifndef __MOVIES__
  34. #include <Movies.h>
  35. #endif
  36.  
  37.  
  38.  
  39. #if PRAGMA_ONCE
  40. #pragma once
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_STRUCT_ALIGN
  52.     #pragma options align=mac68k
  53. #elif PRAGMA_STRUCT_PACKPUSH
  54.     #pragma pack(push, 2)
  55. #elif PRAGMA_STRUCT_PACK
  56.     #pragma pack(2)
  57. #endif
  58.  
  59. /*
  60.                         * * *  N O T E  * * *
  61.  
  62.     This file has been updated to include Sound Manager 3.3 interfaces.
  63.  
  64.     Some of the Sound Manager 3.0 interfaces were not put into the InterfaceLib
  65.     that originally shipped with the PowerMacs. These missing functions and the
  66.     new 3.3 interfaces have been released in the SoundLib library for PowerPC
  67.     developers to link with. The runtime library for these functions are
  68.     installed by the Sound Manager. The following functions are found in SoundLib.
  69.  
  70.         GetCompressionInfo(), GetSoundPreference(), SetSoundPreference(),
  71.         UnsignedFixedMulDiv(), SndGetInfo(), SndSetInfo(), GetSoundOutputInfo(),
  72.         SetSoundOutputInfo(), GetCompressionName(), SoundConverterOpen(),
  73.         SoundConverterClose(), SoundConverterGetBufferSizes(), SoundConverterBeginConversion(),
  74.         SoundConverterConvertBuffer(), SoundConverterEndConversion(),
  75.         AudioGetBass, AudioGetInfo, AudioGetMute, AudioGetOutputDevice,
  76.         AudioGetTreble, AudioGetVolume, AudioMuteOnEvent, AudioSetBass,
  77.         AudioSetMute, AudioSetToDefaults, AudioSetTreble, AudioSetVolume,
  78.         OpenMixerSoundComponent, CloseMixerSoundComponent, SoundComponentAddSource,
  79.         SoundComponentGetInfo, SoundComponentGetSource, SoundComponentGetSourceData,
  80.         SoundComponentInitOutputDevice, SoundComponentPauseSource,
  81.         SoundComponentPlaySourceBuffer, SoundComponentRemoveSource,
  82.         SoundComponentSetInfo, SoundComponentSetOutput, SoundComponentSetSource,
  83.         SoundComponentStartSource, SoundComponentStopSource
  84.         ParseAIFFHeader(), ParseSndHeader()
  85. */
  86. /*
  87.     Interfaces for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  88.  
  89.     These items are no longer defined, but appear here so that someone
  90.     searching the interfaces might find them. If you are using one of these
  91.     items, you must change your code to support the Sound Manager.
  92.  
  93.         swMode, ftMode, ffMode
  94.         FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  95.         SndCompletionProcPtr
  96.         StartSound, StopSound, SoundDone
  97. */
  98. /*
  99.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100.    constants
  101.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102. */
  103. #define twelfthRootTwo 1.05946309435
  104.  
  105.  
  106. enum {
  107.     soundListRsrc                = FOUR_CHAR_CODE('snd '),        /*Resource type used by Sound Manager*/
  108.     rate48khz                    = (long)0xBB800000,                /*48000.00000 in fixed-point*/
  109.     rate44khz                    = (long)0xAC440000,                /*44100.00000 in fixed-point*/
  110.     rate22050hz                    = 0x56220000,                    /*22050.00000 in fixed-point*/
  111.     rate22khz                    = 0x56EE8BA3,                    /*22254.54545 in fixed-point*/
  112.     rate11khz                    = 0x2B7745D1,                    /*11127.27273 in fixed-point*/
  113.     rate11025hz                    = 0x2B110000,                    /*11025.00000 in fixed-point*/
  114.                                                                 /*synthesizer numbers for SndNewChannel*/
  115.     squareWaveSynth                = 1,                            /*square wave synthesizer*/
  116.     waveTableSynth                = 3,                            /*wave table synthesizer*/
  117.     sampledSynth                = 5,                            /*sampled sound synthesizer*/
  118.                                                                 /*old Sound Manager MACE synthesizer numbers*/
  119.     MACE3snthID                    = 11,
  120.     MACE6snthID                    = 13,
  121.     kMiddleC                    = 60,                            /*MIDI note value for middle C*/
  122.     kSimpleBeepID                = 1,                            /*reserved resource ID for Simple Beep*/
  123.     kFullVolume                    = 0x0100,                        /*1.0, setting for full hardware output volume*/
  124.     kNoVolume                    = 0,                            /*setting for no sound volume*/
  125.     stdQLength                    = 128,
  126.     dataOffsetFlag                = 0x8000,
  127.     kUseOptionalOutputDevice    = -1,                            /*only for Sound Manager 3.0 or later*/
  128.     notCompressed                = 0,                            /*compression ID's*/
  129.     fixedCompression            = -1,                            /*compression ID for fixed-sized compression*/
  130.     variableCompression            = -2,                            /*compression ID for variable-sized compression*/
  131.     twoToOne                    = 1,
  132.     eightToThree                = 2,
  133.     threeToOne                    = 3,
  134.     sixToOne                    = 4,
  135.     sixToOnePacketSize            = 8,
  136.     threeToOnePacketSize        = 16,
  137.     stateBlockSize                = 64,
  138.     leftOverBlockSize            = 32,
  139.     firstSoundFormat            = 0x0001,                        /*general sound format*/
  140.     secondSoundFormat            = 0x0002,                        /*special sampled sound format (HyperCard)*/
  141.     dbBufferReady                = 0x00000001,                    /*double buffer is filled*/
  142.     dbLastBuffer                = 0x00000004,                    /*last double buffer to play*/
  143.     sysBeepDisable                = 0x0000,                        /*SysBeep() enable flags*/
  144.     sysBeepEnable                = (1 << 0),
  145.     sysBeepSynchronous            = (1 << 1),                        /*if bit set, make alert sounds synchronous*/
  146.     unitTypeNoSelection            = 0xFFFF,                        /*unitTypes for AudioSelection.unitType*/
  147.     unitTypeSeconds                = 0x0000
  148. };
  149.  
  150.  
  151. enum {
  152.     stdSH                        = 0x00,                            /*Standard sound header encode value*/
  153.     extSH                        = 0xFF,                            /*Extended sound header encode value*/
  154.     cmpSH                        = 0xFE                            /*Compressed sound header encode value*/
  155. };
  156.  
  157. /*command numbers for SndDoCommand and SndDoImmediate*/
  158.  
  159. enum {
  160.     nullCmd                        = 0,
  161.     initCmd                        = 1,
  162.     freeCmd                        = 2,
  163.     quietCmd                    = 3,
  164.     flushCmd                    = 4,
  165.     reInitCmd                    = 5,
  166.     waitCmd                        = 10,
  167.     pauseCmd                    = 11,
  168.     resumeCmd                    = 12,
  169.     callBackCmd                    = 13,
  170.     syncCmd                        = 14,
  171.     availableCmd                = 24,
  172.     versionCmd                    = 25,
  173.     totalLoadCmd                = 26,
  174.     loadCmd                        = 27,
  175.     freqDurationCmd                = 40,
  176.     restCmd                        = 41,
  177.     freqCmd                        = 42,
  178.     ampCmd                        = 43,
  179.     timbreCmd                    = 44,
  180.     getAmpCmd                    = 45,
  181.     volumeCmd                    = 46,                            /*sound manager 3.0 or later only*/
  182.     getVolumeCmd                = 47,                            /*sound manager 3.0 or later only*/
  183.     clockComponentCmd            = 50,                            /*sound manager 3.2.1 or later only*/
  184.     getClockComponentCmd        = 51,                            /*sound manager 3.2.1 or later only*/
  185.     waveTableCmd                = 60,
  186.     phaseCmd                    = 61,
  187.     soundCmd                    = 80,
  188.     bufferCmd                    = 81,
  189.     rateCmd                        = 82,
  190.     continueCmd                    = 83,
  191.     doubleBufferCmd                = 84,
  192.     getRateCmd                    = 85,
  193.     rateMultiplierCmd            = 86,
  194.     getRateMultiplierCmd        = 87,
  195.     sizeCmd                        = 90,                            /*obsolete command*/
  196.     convertCmd                    = 91                            /*obsolete MACE command*/
  197. };
  198.  
  199. #if OLDROUTINENAMES
  200. /*channel initialization parameters*/
  201.  
  202. enum {
  203.     waveInitChannelMask            = 0x07,
  204.     waveInitChannel0            = 0x04,                            /*wave table only, Sound Manager 2.0 and earlier*/
  205.     waveInitChannel1            = 0x05,                            /*wave table only, Sound Manager 2.0 and earlier*/
  206.     waveInitChannel2            = 0x06,                            /*wave table only, Sound Manager 2.0 and earlier*/
  207.     waveInitChannel3            = 0x07,                            /*wave table only, Sound Manager 2.0 and earlier*/
  208.     initChan0                    = waveInitChannel0,                /*obsolete spelling*/
  209.     initChan1                    = waveInitChannel1,                /*obsolete spelling*/
  210.     initChan2                    = waveInitChannel2,                /*obsolete spelling*/
  211.     initChan3                    = waveInitChannel3                /*obsolete spelling*/
  212. };
  213.  
  214.  
  215. enum {
  216.     outsideCmpSH                = 0,                            /*obsolete MACE constant*/
  217.     insideCmpSH                    = 1,                            /*obsolete MACE constant*/
  218.     aceSuccess                    = 0,                            /*obsolete MACE constant*/
  219.     aceMemFull                    = 1,                            /*obsolete MACE constant*/
  220.     aceNilBlock                    = 2,                            /*obsolete MACE constant*/
  221.     aceBadComp                    = 3,                            /*obsolete MACE constant*/
  222.     aceBadEncode                = 4,                            /*obsolete MACE constant*/
  223.     aceBadDest                    = 5,                            /*obsolete MACE constant*/
  224.     aceBadCmd                    = 6                                /*obsolete MACE constant*/
  225. };
  226.  
  227. #endif  /* OLDROUTINENAMES */
  228.  
  229.  
  230. enum {
  231.     initChanLeft                = 0x0002,                        /*left stereo channel*/
  232.     initChanRight                = 0x0003,                        /*right stereo channel*/
  233.     initNoInterp                = 0x0004,                        /*no linear interpolation*/
  234.     initNoDrop                    = 0x0008,                        /*no drop-sample conversion*/
  235.     initMono                    = 0x0080,                        /*monophonic channel*/
  236.     initStereo                    = 0x00C0,                        /*stereo channel*/
  237.     initMACE3                    = 0x0300,                        /*MACE 3:1*/
  238.     initMACE6                    = 0x0400,                        /*MACE 6:1*/
  239.     initPanMask                    = 0x0003,                        /*mask for right/left pan values*/
  240.     initSRateMask                = 0x0030,                        /*mask for sample rate values*/
  241.     initStereoMask                = 0x00C0,                        /*mask for mono/stereo values*/
  242.     initCompMask                = 0xFF00                        /*mask for compression IDs*/
  243. };
  244.  
  245. /*Get&Set Sound Information Selectors*/
  246.  
  247. enum {
  248.     siActiveChannels            = FOUR_CHAR_CODE('chac'),        /*active channels*/
  249.     siActiveLevels                = FOUR_CHAR_CODE('lmac'),        /*active meter levels*/
  250.     siAGCOnOff                    = FOUR_CHAR_CODE('agc '),        /*automatic gain control state*/
  251.     siAsync                        = FOUR_CHAR_CODE('asyn'),        /*asynchronous capability*/
  252.     siAVDisplayBehavior            = FOUR_CHAR_CODE('avdb'),
  253.     siChannelAvailable            = FOUR_CHAR_CODE('chav'),        /*number of channels available*/
  254.     siCompressionAvailable        = FOUR_CHAR_CODE('cmav'),        /*compression types available*/
  255.     siCompressionFactor            = FOUR_CHAR_CODE('cmfa'),        /*current compression factor*/
  256.     siCompressionHeader            = FOUR_CHAR_CODE('cmhd'),        /*return compression header*/
  257.     siCompressionNames            = FOUR_CHAR_CODE('cnam'),        /*compression type names available*/
  258.     siCompressionParams            = FOUR_CHAR_CODE('cmpp'),        /*compression parameters*/
  259.     siCompressionType            = FOUR_CHAR_CODE('comp'),        /*current compression type*/
  260.     siContinuous                = FOUR_CHAR_CODE('cont'),        /*continous recording*/
  261.     siDeviceBufferInfo            = FOUR_CHAR_CODE('dbin'),        /*size of interrupt buffer*/
  262.     siDeviceConnected            = FOUR_CHAR_CODE('dcon'),        /*input device connection status*/
  263.     siDeviceIcon                = FOUR_CHAR_CODE('icon'),        /*input device icon*/
  264.     siDeviceName                = FOUR_CHAR_CODE('name'),        /*input device name*/
  265.     siHardwareBalance            = FOUR_CHAR_CODE('hbal'),
  266.     siHardwareBalanceSteps        = FOUR_CHAR_CODE('hbls'),
  267.     siHardwareBass                = FOUR_CHAR_CODE('hbas'),
  268.     siHardwareBassSteps            = FOUR_CHAR_CODE('hbst'),
  269.     siHardwareBusy                = FOUR_CHAR_CODE('hwbs'),        /*sound hardware is in use*/
  270.     siHardwareFormat            = FOUR_CHAR_CODE('hwfm'),        /*get hardware format*/
  271.     siHardwareMute                = FOUR_CHAR_CODE('hmut'),        /*mute state of all hardware*/
  272.     siHardwareTreble            = FOUR_CHAR_CODE('htrb'),
  273.     siHardwareTrebleSteps        = FOUR_CHAR_CODE('hwts'),
  274.     siHardwareVolume            = FOUR_CHAR_CODE('hvol'),        /*volume level of all hardware*/
  275.     siHardwareVolumeSteps        = FOUR_CHAR_CODE('hstp'),        /*number of volume steps for hardware*/
  276.     siHeadphoneMute                = FOUR_CHAR_CODE('pmut'),        /*mute state of headphones*/
  277.     siHeadphoneVolume            = FOUR_CHAR_CODE('pvol'),        /*volume level of headphones*/
  278.     siHeadphoneVolumeSteps        = FOUR_CHAR_CODE('hdst'),        /*number of volume steps for headphones*/
  279.     siInputAvailable            = FOUR_CHAR_CODE('inav'),        /*input sources available*/
  280.     siInputGain                    = FOUR_CHAR_CODE('gain'),        /*input gain*/
  281.     siInputSource                = FOUR_CHAR_CODE('sour'),        /*input source selector*/
  282.     siInputSourceNames            = FOUR_CHAR_CODE('snam'),        /*input source names*/
  283.     siLevelMeterOnOff            = FOUR_CHAR_CODE('lmet'),        /*level meter state*/
  284.     siModemGain                    = FOUR_CHAR_CODE('mgai'),        /*modem input gain*/
  285.     siMonitorAvailable            = FOUR_CHAR_CODE('mnav'),
  286.     siMonitorSource                = FOUR_CHAR_CODE('mons'),
  287.     siNumberChannels            = FOUR_CHAR_CODE('chan'),        /*current number of channels*/
  288.     siOptionsDialog                = FOUR_CHAR_CODE('optd'),        /*display options dialog*/
  289.     siPlayThruOnOff                = FOUR_CHAR_CODE('plth'),        /*playthrough state*/
  290.     siPostMixerSoundComponent    = FOUR_CHAR_CODE('psmx'),        /*install post-mixer effect*/
  291.     siPreMixerSoundComponent    = FOUR_CHAR_CODE('prmx'),        /*install pre-mixer effect*/
  292.     siQuality                    = FOUR_CHAR_CODE('qual'),        /*quality setting*/
  293.     siRateMultiplier            = FOUR_CHAR_CODE('rmul'),        /*throttle rate setting*/
  294.     siRecordingQuality            = FOUR_CHAR_CODE('qual'),        /*recording quality*/
  295.     siSampleRate                = FOUR_CHAR_CODE('srat'),        /*current sample rate*/
  296.     siSampleRateAvailable        = FOUR_CHAR_CODE('srav'),        /*sample rates available*/
  297.     siSampleSize                = FOUR_CHAR_CODE('ssiz'),        /*current sample size*/
  298.     siSampleSizeAvailable        = FOUR_CHAR_CODE('ssav'),        /*sample sizes available*/
  299.     siSetupCDAudio                = FOUR_CHAR_CODE('sucd'),        /*setup sound hardware for CD audio*/
  300.     siSetupModemAudio            = FOUR_CHAR_CODE('sumd'),        /*setup sound hardware for modem audio*/
  301.     siSlopeAndIntercept            = FOUR_CHAR_CODE('flap'),        /*floating point variables for conversion*/
  302.     siSoundClock                = FOUR_CHAR_CODE('sclk'),
  303.     siSpeakerMute                = FOUR_CHAR_CODE('smut'),        /*mute state of all built-in speaker*/
  304.     siSpeakerVolume                = FOUR_CHAR_CODE('svol'),        /*volume level of built-in speaker*/
  305.     siSSpCPULoadLimit            = FOUR_CHAR_CODE('3dll'),
  306.     siSSpLocalization            = FOUR_CHAR_CODE('3dif'),
  307.     siSSpSpeakerSetup            = FOUR_CHAR_CODE('3dst'),
  308.     siStereoInputGain            = FOUR_CHAR_CODE('sgai'),        /*stereo input gain*/
  309.     siSubwooferMute                = FOUR_CHAR_CODE('bmut'),        /*mute state of sub-woofer*/
  310.     siTwosComplementOnOff        = FOUR_CHAR_CODE('twos'),        /*two's complement state*/
  311.     siVolume                    = FOUR_CHAR_CODE('volu'),        /*volume level of source*/
  312.     siVoxRecordInfo                = FOUR_CHAR_CODE('voxr'),        /*VOX record parameters*/
  313.     siVoxStopInfo                = FOUR_CHAR_CODE('voxs'),        /*VOX stop parameters*/
  314.     siWideStereo                = FOUR_CHAR_CODE('wide')        /*wide stereo setting*/
  315. };
  316.  
  317.  
  318. enum {
  319.     siCloseDriver                = FOUR_CHAR_CODE('clos'),        /*reserved for internal use only*/
  320.     siInitializeDriver            = FOUR_CHAR_CODE('init'),        /*reserved for internal use only*/
  321.     siPauseRecording            = FOUR_CHAR_CODE('paus'),        /*reserved for internal use only*/
  322.     siUserInterruptProc            = FOUR_CHAR_CODE('user')        /*reserved for internal use only*/
  323. };
  324.  
  325. /*Sound Component Types and Subtypes*/
  326.  
  327. enum {
  328.     kNoSoundComponentType        = FOUR_CHAR_CODE('****'),
  329.     kSoundComponentType            = FOUR_CHAR_CODE('sift'),        /*component type*/
  330.     kSoundComponentPPCType        = FOUR_CHAR_CODE('nift'),        /*component type for PowerPC code*/
  331.     kRate8SubType                = FOUR_CHAR_CODE('ratb'),        /*8-bit rate converter*/
  332.     kRate16SubType                = FOUR_CHAR_CODE('ratw'),        /*16-bit rate converter*/
  333.     kConverterSubType            = FOUR_CHAR_CODE('conv'),        /*sample format converter*/
  334.     kSndSourceSubType            = FOUR_CHAR_CODE('sour'),        /*generic source component*/
  335.     kMixerType                    = FOUR_CHAR_CODE('mixr'),
  336.     kMixer8SubType                = FOUR_CHAR_CODE('mixb'),        /*8-bit mixer*/
  337.     kMixer16SubType                = FOUR_CHAR_CODE('mixw'),        /*16-bit mixer*/
  338.     kSoundOutputDeviceType        = FOUR_CHAR_CODE('sdev'),        /*sound output component*/
  339.     kClassicSubType                = FOUR_CHAR_CODE('clas'),        /*classic hardware, i.e. Mac Plus*/
  340.     kASCSubType                    = FOUR_CHAR_CODE('asc '),        /*Apple Sound Chip device*/
  341.     kDSPSubType                    = FOUR_CHAR_CODE('dsp '),        /*DSP device*/
  342.     kAwacsSubType                = FOUR_CHAR_CODE('awac'),        /*Another of Will's Audio Chips device*/
  343.     kGCAwacsSubType                = FOUR_CHAR_CODE('awgc'),        /*Awacs audio with Grand Central DMA*/
  344.     kSingerSubType                = FOUR_CHAR_CODE('sing'),        /*Singer (via Whitney) based sound*/
  345.     kSinger2SubType                = FOUR_CHAR_CODE('sng2'),        /*Singer 2 (via Whitney) for Acme*/
  346.     kWhitSubType                = FOUR_CHAR_CODE('whit'),        /*Whit sound component for PrimeTime 3*/
  347.     kSoundBlasterSubType        = FOUR_CHAR_CODE('sbls'),        /*Sound Blaster for CHRP*/
  348.     kSoundCompressor            = FOUR_CHAR_CODE('scom'),
  349.     kSoundDecompressor            = FOUR_CHAR_CODE('sdec'),
  350.     kSoundEffectsType            = FOUR_CHAR_CODE('snfx'),        /*sound effects type*/
  351.     kSSpLocalizationSubType        = FOUR_CHAR_CODE('snd3')
  352. };
  353.  
  354. /*Format Types*/
  355.  
  356. enum {
  357.     kSoundNotCompressed            = FOUR_CHAR_CODE('NONE'),        /*sound is not compressed*/
  358.     kOffsetBinary                = FOUR_CHAR_CODE('raw '),        /*offset binary*/
  359.     kMACE3Compression            = FOUR_CHAR_CODE('MAC3'),        /*MACE 3:1*/
  360.     kMACE6Compression            = FOUR_CHAR_CODE('MAC6'),        /*MACE 6:1*/
  361.     kCDXA4Compression            = FOUR_CHAR_CODE('cdx4'),        /*CD/XA 4:1*/
  362.     kCDXA2Compression            = FOUR_CHAR_CODE('cdx2'),        /*CD/XA 2:1*/
  363.     kIMACompression                = FOUR_CHAR_CODE('ima4'),        /*IMA 4:1*/
  364.     kULawCompression            = FOUR_CHAR_CODE('ulaw'),        /*µLaw 2:1*/
  365.     kALawCompression            = FOUR_CHAR_CODE('alaw'),        /*aLaw 2:1*/
  366.     kLittleEndianFormat            = FOUR_CHAR_CODE('sowt'),        /*Little-endian*/
  367.     kFloat32Format                = FOUR_CHAR_CODE('fl32'),        /*32-bit floating point*/
  368.     kFloat64Format                = FOUR_CHAR_CODE('fl64'),        /*64-bit floating point*/
  369.     kTwosComplement                = FOUR_CHAR_CODE('twos')        /*old name for compatibility*/
  370. };
  371.  
  372. /*Features Flags*/
  373.  
  374. enum {
  375.     k8BitRawIn                    = (1 << 0),                        /*data description*/
  376.     k8BitTwosIn                    = (1 << 1),
  377.     k16BitIn                    = (1 << 2),
  378.     kStereoIn                    = (1 << 3),
  379.     k8BitRawOut                    = (1 << 8),
  380.     k8BitTwosOut                = (1 << 9),
  381.     k16BitOut                    = (1 << 10),
  382.     kStereoOut                    = (1 << 11),
  383.     kReverse                    = (1L << 16),                    /*  function description*/
  384.     kRateConvert                = (1L << 17),
  385.     kCreateSoundSource            = (1L << 18),
  386.     kHighQuality                = (1L << 22),                    /*  performance description*/
  387.     kNonRealTime                = (1L << 23)
  388. };
  389.  
  390. /*SoundComponentPlaySourceBuffer action flags*/
  391.  
  392. enum {
  393.     kSourcePaused                = (1 << 0),
  394.     kPassThrough                = (1L << 16),
  395.     kNoSoundComponentChain        = (1L << 17)
  396. };
  397.  
  398. /*SoundParamBlock flags, usefull for OpenMixerSoundComponent*/
  399.  
  400. enum {
  401.     kNoMixing                    = (1 << 0),                        /*don't mix source*/
  402.     kNoSampleRateConversion        = (1 << 1),                        /*don't convert sample rate (i.e. 11 kHz -> 22 kHz)*/
  403.     kNoSampleSizeConversion        = (1 << 2),                        /*don't convert sample size (i.e. 16 -> 8)*/
  404.     kNoSampleFormatConversion    = (1 << 3),                        /*don't convert sample format (i.e. 'twos' -> 'raw ')*/
  405.     kNoChannelConversion        = (1 << 4),                        /*don't convert stereo/mono*/
  406.     kNoDecompression            = (1 << 5),                        /*don't decompress (i.e. 'MAC3' -> 'raw ')*/
  407.     kNoVolumeConversion            = (1 << 6),                        /*don't apply volume*/
  408.     kNoRealtimeProcessing        = (1 << 7),                        /*won't run at interrupt time*/
  409.     kScheduledSource            = (1 << 8)                        /*source is scheduled*/
  410. };
  411.  
  412. /*SoundParamBlock quality settings*/
  413.  
  414. enum {
  415.     kBestQuality                = (1 << 0)                        /*use interpolation in rate conversion*/
  416. };
  417.  
  418. /*useful bit masks*/
  419.  
  420. enum {
  421.     kInputMask                    = 0x000000FF,                    /*masks off input bits*/
  422.     kOutputMask                    = 0x0000FF00,                    /*masks off output bits*/
  423.     kOutputShift                = 8,                            /*amount output bits are shifted*/
  424.     kActionMask                    = 0x00FF0000,                    /*masks off action bits*/
  425.     kSoundComponentBits            = 0x00FFFFFF
  426. };
  427.  
  428. /*siAVDisplayBehavior types*/
  429.  
  430. enum {
  431.     kAVDisplayHeadphoneRemove    = 0,                            /* monitor does not have a headphone attached*/
  432.     kAVDisplayHeadphoneInsert    = 1,                            /* monitor has a headphone attached*/
  433.     kAVDisplayPlainTalkRemove    = 2,                            /* monitor either sending no input through CPU input port or unable to tell if input is coming in*/
  434.     kAVDisplayPlainTalkInsert    = 3                                /* monitor sending PlainTalk level microphone source input through sound input port*/
  435. };
  436.  
  437. /*Audio Component constants*/
  438.  
  439. enum {
  440.                                                                 /*Values for whichChannel parameter*/
  441.     audioAllChannels            = 0,                            /*All channels (usually interpreted as both left and right)*/
  442.     audioLeftChannel            = 1,                            /*Left channel*/
  443.     audioRightChannel            = 2,                            /*Right channel*/
  444.                                                                 /*Values for mute parameter*/
  445.     audioUnmuted                = 0,                            /*Device is unmuted*/
  446.     audioMuted                    = 1,                            /*Device is muted*/
  447.                                                                 /*Capabilities flags definitions*/
  448.     audioDoesMono                = (1L << 0),                    /*Device supports mono output*/
  449.     audioDoesStereo                = (1L << 1),                    /*Device supports stereo output*/
  450.     audioDoesIndependentChannels = (1L << 2)                    /*Device supports independent software control of each channel*/
  451. };
  452.  
  453. /*Sound Input Qualities*/
  454.  
  455. enum {
  456.     siCDQuality                    = FOUR_CHAR_CODE('cd  '),        /*44.1kHz, stereo, 16 bit*/
  457.     siBestQuality                = FOUR_CHAR_CODE('best'),        /*22kHz, mono, 8 bit*/
  458.     siBetterQuality                = FOUR_CHAR_CODE('betr'),        /*22kHz, mono, MACE 3:1*/
  459.     siGoodQuality                = FOUR_CHAR_CODE('good')        /*22kHz, mono, MACE 6:1*/
  460. };
  461.  
  462.  
  463. enum {
  464.     siDeviceIsConnected            = 1,                            /*input device is connected and ready for input*/
  465.     siDeviceNotConnected        = 0,                            /*input device is not connected*/
  466.     siDontKnowIfConnected        = -1,                            /*can't tell if input device is connected*/
  467.     siReadPermission            = 0,                            /*permission passed to SPBOpenDevice*/
  468.     siWritePermission            = 1                                /*permission passed to SPBOpenDevice*/
  469. };
  470.  
  471. /*
  472.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  473.    typedefs
  474.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  475. */
  476.  
  477. struct SndCommand {
  478.     unsigned short                     cmd;
  479.     short                             param1;
  480.     long                             param2;
  481. };
  482. typedef struct SndCommand SndCommand;
  483.  
  484. typedef struct SndChannel                 SndChannel;
  485. typedef SndChannel *                    SndChannelPtr;
  486. typedef CALLBACK_API( void , SndCallBackProcPtr )(SndChannelPtr chan, SndCommand *cmd);
  487. typedef STACK_UPP_TYPE(SndCallBackProcPtr)                         SndCallBackUPP;
  488.  
  489.  
  490. struct SndChannel {
  491.     SndChannelPtr                     nextChan;
  492.     Ptr                             firstMod;                    /* reserved for the Sound Manager */
  493.     SndCallBackUPP                     callBack;
  494.     long                             userInfo;
  495.     long                             wait;                        /* The following is for internal Sound Manager use only.*/
  496.     SndCommand                         cmdInProgress;
  497.     short                             flags;
  498.     short                             qLength;
  499.     short                             qHead;
  500.     short                             qTail;
  501.     SndCommand                         queue[128];
  502. };
  503.  
  504. /*MACE structures*/
  505. struct StateBlock {
  506.     short                             stateVar[64];
  507. };
  508. typedef struct StateBlock StateBlock;
  509.  
  510. typedef StateBlock *                    StateBlockPtr;
  511. struct LeftOverBlock {
  512.     unsigned long                     count;
  513.     SInt8                             sampleArea[32];
  514. };
  515. typedef struct LeftOverBlock LeftOverBlock;
  516.  
  517. typedef LeftOverBlock *                    LeftOverBlockPtr;
  518. struct ModRef {
  519.     unsigned short                     modNumber;
  520.     long                             modInit;
  521. };
  522. typedef struct ModRef ModRef;
  523.  
  524. struct SndListResource {
  525.     short                             format;
  526.     short                             numModifiers;
  527.     ModRef                             modifierPart[1];
  528.     short                             numCommands;
  529.     SndCommand                         commandPart[1];
  530.     UInt8                             dataPart[1];
  531. };
  532. typedef struct SndListResource SndListResource;
  533.  
  534. typedef SndListResource *                SndListPtr;
  535. typedef SndListPtr *                    SndListHndl;
  536. typedef SndListPtr *                    SndListHandle;
  537. /*HyperCard sound resource format*/
  538. struct Snd2ListResource {
  539.     short                             format;
  540.     short                             refCount;
  541.     short                             numCommands;
  542.     SndCommand                         commandPart[1];
  543.     UInt8                             dataPart[1];
  544. };
  545. typedef struct Snd2ListResource Snd2ListResource;
  546.  
  547. typedef Snd2ListResource *                Snd2ListPtr;
  548. typedef Snd2ListPtr *                    Snd2ListHndl;
  549. typedef Snd2ListPtr *                    Snd2ListHandle;
  550. struct SoundHeader {
  551.     Ptr                             samplePtr;                    /*if NIL then samples are in sampleArea*/
  552.     unsigned long                     length;                        /*length of sound in bytes*/
  553.     UnsignedFixed                     sampleRate;                    /*sample rate for this sound*/
  554.     unsigned long                     loopStart;                    /*start of looping portion*/
  555.     unsigned long                     loopEnd;                    /*end of looping portion*/
  556.     UInt8                             encode;                        /*header encoding*/
  557.     UInt8                             baseFrequency;                /*baseFrequency value*/
  558.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  559. };
  560. typedef struct SoundHeader SoundHeader;
  561.  
  562. typedef SoundHeader *                    SoundHeaderPtr;
  563. struct CmpSoundHeader {
  564.     Ptr                             samplePtr;                    /*if nil then samples are in sample area*/
  565.     unsigned long                     numChannels;                /*number of channels i.e. mono = 1*/
  566.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  567.     unsigned long                     loopStart;                    /*loopStart of sound before compression*/
  568.     unsigned long                     loopEnd;                    /*loopEnd of sound before compression*/
  569.     UInt8                             encode;                        /*data structure used , stdSH, extSH, or cmpSH*/
  570.     UInt8                             baseFrequency;                /*same meaning as regular SoundHeader*/
  571.     unsigned long                     numFrames;                    /*length in frames ( packetFrames or sampleFrames )*/
  572.     extended80                         AIFFSampleRate;                /*IEEE sample rate*/
  573.     Ptr                             markerChunk;                /*sync track*/
  574.     OSType                             format;                        /*data format type, was futureUse1*/
  575.     unsigned long                     futureUse2;                    /*reserved by Apple*/
  576.     StateBlockPtr                     stateVars;                    /*pointer to State Block*/
  577.     LeftOverBlockPtr                 leftOverSamples;            /*used to save truncated samples between compression calls*/
  578.     short                             compressionID;                /*0 means no compression, non zero means compressionID*/
  579.     unsigned short                     packetSize;                    /*number of bits in compressed sample packet*/
  580.     unsigned short                     snthID;                        /*resource ID of Sound Manager snth that contains NRT C/E*/
  581.     unsigned short                     sampleSize;                    /*number of bits in non-compressed sample*/
  582.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  583. };
  584. typedef struct CmpSoundHeader CmpSoundHeader;
  585.  
  586. typedef CmpSoundHeader *                CmpSoundHeaderPtr;
  587. struct ExtSoundHeader {
  588.     Ptr                             samplePtr;                    /*if nil then samples are in sample area*/
  589.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  590.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  591.     unsigned long                     loopStart;                    /*same meaning as regular SoundHeader*/
  592.     unsigned long                     loopEnd;                    /*same meaning as regular SoundHeader*/
  593.     UInt8                             encode;                        /*data structure used , stdSH, extSH, or cmpSH*/
  594.     UInt8                             baseFrequency;                /*same meaning as regular SoundHeader*/
  595.     unsigned long                     numFrames;                    /*length in total number of frames*/
  596.     extended80                         AIFFSampleRate;                /*IEEE sample rate*/
  597.     Ptr                             markerChunk;                /*sync track*/
  598.     Ptr                             instrumentChunks;            /*AIFF instrument chunks*/
  599.     Ptr                             AESRecording;
  600.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  601.     unsigned short                     futureUse1;                    /*reserved by Apple*/
  602.     unsigned long                     futureUse2;                    /*reserved by Apple*/
  603.     unsigned long                     futureUse3;                    /*reserved by Apple*/
  604.     unsigned long                     futureUse4;                    /*reserved by Apple*/
  605.     UInt8                             sampleArea[1];                /*space for when samples follow directly*/
  606. };
  607. typedef struct ExtSoundHeader ExtSoundHeader;
  608.  
  609. typedef ExtSoundHeader *                ExtSoundHeaderPtr;
  610. union SoundHeaderUnion {
  611.     SoundHeader                     stdHeader;
  612.     CmpSoundHeader                     cmpHeader;
  613.     ExtSoundHeader                     extHeader;
  614. };
  615. typedef union SoundHeaderUnion SoundHeaderUnion;
  616.  
  617. struct ConversionBlock {
  618.     short                             destination;
  619.     short                             unused;
  620.     CmpSoundHeaderPtr                 inputPtr;
  621.     CmpSoundHeaderPtr                 outputPtr;
  622. };
  623. typedef struct ConversionBlock ConversionBlock;
  624.  
  625. typedef ConversionBlock *                ConversionBlockPtr;
  626. struct SMStatus {
  627.     short                             smMaxCPULoad;
  628.     short                             smNumChannels;
  629.     short                             smCurCPULoad;
  630. };
  631. typedef struct SMStatus SMStatus;
  632.  
  633. typedef SMStatus *                        SMStatusPtr;
  634. struct SCStatus {
  635.     UnsignedFixed                     scStartTime;
  636.     UnsignedFixed                     scEndTime;
  637.     UnsignedFixed                     scCurrentTime;
  638.     Boolean                         scChannelBusy;
  639.     Boolean                         scChannelDisposed;
  640.     Boolean                         scChannelPaused;
  641.     Boolean                         scUnused;
  642.     unsigned long                     scChannelAttributes;
  643.     long                             scCPULoad;
  644. };
  645. typedef struct SCStatus SCStatus;
  646.  
  647. typedef SCStatus *                        SCStatusPtr;
  648. struct AudioSelection {
  649.     long                             unitType;
  650.     UnsignedFixed                     selStart;
  651.     UnsignedFixed                     selEnd;
  652. };
  653. typedef struct AudioSelection AudioSelection;
  654.  
  655. typedef AudioSelection *                AudioSelectionPtr;
  656. struct SndDoubleBuffer {
  657.     long                             dbNumFrames;
  658.     long                             dbFlags;
  659.     long                             dbUserInfo[2];
  660.     SInt8                             dbSoundData[1];
  661. };
  662. typedef struct SndDoubleBuffer SndDoubleBuffer;
  663.  
  664. typedef SndDoubleBuffer *                SndDoubleBufferPtr;
  665.  
  666.  
  667. typedef CALLBACK_API( void , SndDoubleBackProcPtr )(SndChannelPtr channel, SndDoubleBufferPtr doubleBufferPtr);
  668. typedef STACK_UPP_TYPE(SndDoubleBackProcPtr)                     SndDoubleBackUPP;
  669.  
  670.  
  671. struct SndDoubleBufferHeader {
  672.     short                             dbhNumChannels;
  673.     short                             dbhSampleSize;
  674.     short                             dbhCompressionID;
  675.     short                             dbhPacketSize;
  676.     UnsignedFixed                     dbhSampleRate;
  677.     SndDoubleBufferPtr                 dbhBufferPtr[2];
  678.     SndDoubleBackUPP                 dbhDoubleBack;
  679. };
  680. typedef struct SndDoubleBufferHeader SndDoubleBufferHeader;
  681.  
  682. typedef SndDoubleBufferHeader *            SndDoubleBufferHeaderPtr;
  683. struct SndDoubleBufferHeader2 {
  684.     short                             dbhNumChannels;
  685.     short                             dbhSampleSize;
  686.     short                             dbhCompressionID;
  687.     short                             dbhPacketSize;
  688.     UnsignedFixed                     dbhSampleRate;
  689.     SndDoubleBufferPtr                 dbhBufferPtr[2];
  690.     SndDoubleBackUPP                 dbhDoubleBack;
  691.     OSType                             dbhFormat;
  692. };
  693. typedef struct SndDoubleBufferHeader2 SndDoubleBufferHeader2;
  694.  
  695. typedef SndDoubleBufferHeader2 *        SndDoubleBufferHeader2Ptr;
  696. struct SoundInfoList {
  697.     short                             count;
  698.     Handle                             infoHandle;
  699. };
  700. typedef struct SoundInfoList SoundInfoList;
  701.  
  702. typedef SoundInfoList *                    SoundInfoListPtr;
  703. struct SoundComponentData {
  704.     long                             flags;
  705.     OSType                             format;
  706.     short                             numChannels;
  707.     short                             sampleSize;
  708.     UnsignedFixed                     sampleRate;
  709.     long                             sampleCount;
  710.     Byte *                            buffer;
  711.     long                             reserved;
  712. };
  713. typedef struct SoundComponentData SoundComponentData;
  714.  
  715. typedef SoundComponentData *            SoundComponentDataPtr;
  716. typedef struct SoundParamBlock             SoundParamBlock;
  717. typedef SoundParamBlock *                SoundParamBlockPtr;
  718. typedef CALLBACK_API( Boolean , SoundParamProcPtr )(SoundParamBlockPtr *pb);
  719. typedef STACK_UPP_TYPE(SoundParamProcPtr)                         SoundParamUPP;
  720. struct SoundParamBlock {
  721.     long                             recordSize;                    /*size of this record in bytes*/
  722.     SoundComponentData                 desc;                        /*description of sound buffer*/
  723.     UnsignedFixed                     rateMultiplier;                /*rate multiplier to apply to sound*/
  724.     short                             leftVolume;                    /*volumes to apply to sound*/
  725.     short                             rightVolume;
  726.     long                             quality;                    /*quality to apply to sound*/
  727.     ComponentInstance                 filter;                        /*filter to apply to sound*/
  728.     SoundParamUPP                     moreRtn;                    /*routine to call to get more data*/
  729.     SoundParamUPP                     completionRtn;                /*routine to call when buffer is complete*/
  730.     long                             refCon;                        /*user refcon*/
  731.     short                             result;                        /*result*/
  732. };
  733.  
  734. struct CompressionInfo {
  735.     long                             recordSize;
  736.     OSType                             format;
  737.     short                             compressionID;
  738.     unsigned short                     samplesPerPacket;
  739.     unsigned short                     bytesPerPacket;
  740.     unsigned short                     bytesPerFrame;
  741.     unsigned short                     bytesPerSample;
  742.     unsigned short                     futureUse1;
  743. };
  744. typedef struct CompressionInfo CompressionInfo;
  745.  
  746. typedef CompressionInfo *                CompressionInfoPtr;
  747. typedef CompressionInfoPtr *            CompressionInfoHandle;
  748. /*private thing to use as a reference to a Sound Converter*/
  749. typedef struct OpaqueSoundConverter*     SoundConverter;
  750. /*private thing to use as a reference to a Sound Source*/
  751. typedef struct OpaqueSoundSource*         SoundSource;
  752. typedef SoundSource *                    SoundSourcePtr;
  753.  
  754.  
  755. struct SoundComponentLink {
  756.     ComponentDescription             description;                /*Describes the sound component*/
  757.     SoundSource                     mixerID;                    /*Reserved by Apple*/
  758.     SoundSource *                    linkID;                        /*Reserved by Apple*/
  759. };
  760. typedef struct SoundComponentLink SoundComponentLink;
  761.  
  762. typedef SoundComponentLink *            SoundComponentLinkPtr;
  763. struct AudioInfo {
  764.     long                             capabilitiesFlags;            /*Describes device capabilities*/
  765.     long                             reserved;                    /*Reserved by Apple*/
  766.     unsigned short                     numVolumeSteps;                /*Number of significant increments between min and max volume*/
  767. };
  768. typedef struct AudioInfo AudioInfo;
  769.  
  770. typedef AudioInfo *                        AudioInfoPtr;
  771.  
  772.  
  773.  
  774. /*
  775.    These two routines for Get/SetSoundVol should no longer be used.
  776.    They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  777.    Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  778. */
  779.  
  780. #if OLDROUTINENAMES && TARGET_CPU_68K
  781. EXTERN_API( void )
  782. SetSoundVol                        (short                     level);
  783.  
  784.  
  785.                                                                                             #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  786.                                                                                             #pragma parameter GetSoundVol(__A0)
  787.                                                                                             #endif
  788. EXTERN_API( void )
  789. GetSoundVol                        (short *                level)                                THREEWORDINLINE(0x4218, 0x10B8, 0x0260);
  790.  
  791. #endif  /* OLDROUTINENAMES && TARGET_CPU_68K */
  792.  
  793.  
  794.  
  795. /* Sound Input Structures*/
  796. typedef struct SPB                         SPB;
  797. typedef SPB *                            SPBPtr;
  798.  
  799.  
  800. /*user procedures called by sound input routines*/
  801. typedef CALLBACK_API( void , SIInterruptProcPtr )(SPBPtr inParamPtr, Ptr dataBuffer, short peakAmplitude, long sampleSize);
  802. /*
  803.     WARNING: SIInterruptProcPtr uses register based parameters under classic 68k
  804.              and cannot be written in a high-level language without 
  805.              the help of mixed mode or assembly glue.
  806. */
  807. typedef CALLBACK_API( void , FilePlayCompletionProcPtr )(SndChannelPtr chan);
  808. typedef CALLBACK_API( void , SICompletionProcPtr )(SPBPtr inParamPtr);
  809. typedef REGISTER_UPP_TYPE(SIInterruptProcPtr)                     SIInterruptUPP;
  810. typedef STACK_UPP_TYPE(FilePlayCompletionProcPtr)                 FilePlayCompletionUPP;
  811. typedef STACK_UPP_TYPE(SICompletionProcPtr)                     SICompletionUPP;
  812.  
  813.  
  814. /*Sound Input Parameter Block*/
  815. struct SPB {
  816.     long                             inRefNum;                    /*reference number of sound input device*/
  817.     unsigned long                     count;                        /*number of bytes to record*/
  818.     unsigned long                     milliseconds;                /*number of milliseconds to record*/
  819.     unsigned long                     bufferLength;                /*length of buffer in bytes*/
  820.     Ptr                             bufferPtr;                    /*buffer to store sound data in*/
  821.     SICompletionUPP                 completionRoutine;            /*completion routine*/
  822.     SIInterruptUPP                     interruptRoutine;            /*interrupt routine*/
  823.     long                             userLong;                    /*user-defined field*/
  824.     OSErr                             error;                        /*error*/
  825.     long                             unused1;                    /*reserved - must be zero*/
  826. };
  827.  
  828. /*
  829.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  830.    functions for sound components
  831.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  832. */
  833. /*Sound Component Dispatch Selectors*/
  834.  
  835. enum {
  836.     kSoundComponentInitOutputDeviceSelect = 1,                    /*these calls cannot be delegated*/
  837.     kSoundComponentSetSourceSelect = 2,
  838.     kSoundComponentGetSourceSelect = 3,
  839.     kSoundComponentGetSourceDataSelect = 4,
  840.     kSoundComponentSetOutputSelect = 5,
  841.     kDelegatedSoundComponentSelectors = 0x0100,                    /*first selector that can be delegated up the chain*/
  842.                                                                 /*these calls can be delegated and have own range*/
  843.     kSoundComponentAddSourceSelect = kDelegatedSoundComponentSelectors + 1,
  844.     kSoundComponentRemoveSourceSelect = kDelegatedSoundComponentSelectors + 2,
  845.     kSoundComponentGetInfoSelect = kDelegatedSoundComponentSelectors + 3,
  846.     kSoundComponentSetInfoSelect = kDelegatedSoundComponentSelectors + 4,
  847.     kSoundComponentStartSourceSelect = kDelegatedSoundComponentSelectors + 5,
  848.     kSoundComponentStopSourceSelect = kDelegatedSoundComponentSelectors + 6,
  849.     kSoundComponentPauseSourceSelect = kDelegatedSoundComponentSelectors + 7,
  850.     kSoundComponentPlaySourceBufferSelect = kDelegatedSoundComponentSelectors + 8
  851. };
  852.  
  853. /*Audio Component selectors*/
  854.  
  855. enum {
  856.     kAudioGetVolumeSelect        = 0,
  857.     kAudioSetVolumeSelect        = 1,
  858.     kAudioGetMuteSelect            = 2,
  859.     kAudioSetMuteSelect            = 3,
  860.     kAudioSetToDefaultsSelect    = 4,
  861.     kAudioGetInfoSelect            = 5,
  862.     kAudioGetBassSelect            = 6,
  863.     kAudioSetBassSelect            = 7,
  864.     kAudioGetTrebleSelect        = 8,
  865.     kAudioSetTrebleSelect        = 9,
  866.     kAudioGetOutputDeviceSelect    = 10,
  867.     kAudioMuteOnEventSelect        = 129
  868. };
  869.  
  870. /*
  871.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  872.    prototypes
  873.   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  874. */
  875.  
  876. /* Sound Manager routines */
  877. EXTERN_API( void )
  878. SysBeep                            (short                     duration)                            ONEWORDINLINE(0xA9C8);
  879.  
  880. EXTERN_API( OSErr )
  881. SndDoCommand                    (SndChannelPtr             chan,
  882.                                  const SndCommand *        cmd,
  883.                                  Boolean                 noWait)                                ONEWORDINLINE(0xA803);
  884.  
  885. EXTERN_API( OSErr )
  886. SndDoImmediate                    (SndChannelPtr             chan,
  887.                                  const SndCommand *        cmd)                                ONEWORDINLINE(0xA804);
  888.  
  889. EXTERN_API( OSErr )
  890. SndNewChannel                    (SndChannelPtr *        chan,
  891.                                  short                     synth,
  892.                                  long                     init,
  893.                                  SndCallBackUPP         userRoutine)                        ONEWORDINLINE(0xA807);
  894.  
  895. EXTERN_API( OSErr )
  896. SndDisposeChannel                (SndChannelPtr             chan,
  897.                                  Boolean                 quietNow)                            ONEWORDINLINE(0xA801);
  898.  
  899. EXTERN_API( OSErr )
  900. SndPlay                            (SndChannelPtr             chan,
  901.                                  SndListHandle             sndHandle,
  902.                                  Boolean                 async)                                ONEWORDINLINE(0xA805);
  903.  
  904. #if OLDROUTINENAMES
  905. EXTERN_API( OSErr )
  906. SndAddModifier                    (SndChannelPtr             chan,
  907.                                  Ptr                     modifier,
  908.                                  short                     id,
  909.                                  long                     init)                                ONEWORDINLINE(0xA802);
  910.  
  911. #endif  /* OLDROUTINENAMES */
  912.  
  913. EXTERN_API( OSErr )
  914. SndControl                        (short                     id,
  915.                                  SndCommand *            cmd)                                ONEWORDINLINE(0xA806);
  916.  
  917. /* Sound Manager 2.0 and later, uses _SoundDispatch */
  918. EXTERN_API( NumVersion )
  919. SndSoundManagerVersion            (void)                                                        FOURWORDINLINE(0x203C, 0x000C, 0x0008, 0xA800);
  920.  
  921. EXTERN_API( OSErr )
  922. SndStartFilePlay                (SndChannelPtr             chan,
  923.                                  short                     fRefNum,
  924.                                  short                     resNum,
  925.                                  long                     bufferSize,
  926.                                  void *                    theBuffer,
  927.                                  AudioSelectionPtr         theSelection,
  928.                                  FilePlayCompletionUPP     theCompletion,
  929.                                  Boolean                 async)                                FOURWORDINLINE(0x203C, 0x0D00, 0x0008, 0xA800);
  930.  
  931. EXTERN_API( OSErr )
  932. SndPauseFilePlay                (SndChannelPtr             chan)                                FOURWORDINLINE(0x203C, 0x0204, 0x0008, 0xA800);
  933.  
  934. EXTERN_API( OSErr )
  935. SndStopFilePlay                    (SndChannelPtr             chan,
  936.                                  Boolean                 quietNow)                            FOURWORDINLINE(0x203C, 0x0308, 0x0008, 0xA800);
  937.  
  938. EXTERN_API( OSErr )
  939. SndChannelStatus                (SndChannelPtr             chan,
  940.                                  short                     theLength,
  941.                                  SCStatusPtr             theStatus)                            FOURWORDINLINE(0x203C, 0x0510, 0x0008, 0xA800);
  942.  
  943. EXTERN_API( OSErr )
  944. SndManagerStatus                (short                     theLength,
  945.                                  SMStatusPtr             theStatus)                            FOURWORDINLINE(0x203C, 0x0314, 0x0008, 0xA800);
  946.  
  947. EXTERN_API( void )
  948. SndGetSysBeepState                (short *                sysBeepState)                        FOURWORDINLINE(0x203C, 0x0218, 0x0008, 0xA800);
  949.  
  950. EXTERN_API( OSErr )
  951. SndSetSysBeepState                (short                     sysBeepState)                        FOURWORDINLINE(0x203C, 0x011C, 0x0008, 0xA800);
  952.  
  953. EXTERN_API( OSErr )
  954. SndPlayDoubleBuffer                (SndChannelPtr             chan,
  955.                                  SndDoubleBufferHeaderPtr  theParams)                        FOURWORDINLINE(0x203C, 0x0420, 0x0008, 0xA800);
  956.  
  957. /* MACE compression routines */
  958. EXTERN_API( NumVersion )
  959. MACEVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0010, 0xA800);
  960.  
  961. EXTERN_API( void )
  962. Comp3to1                        (const void *            inBuffer,
  963.                                  void *                    outBuffer,
  964.                                  unsigned long             cnt,
  965.                                  StateBlockPtr             inState,
  966.                                  StateBlockPtr             outState,
  967.                                  unsigned long             numChannels,
  968.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0004, 0x0010, 0xA800);
  969.  
  970. EXTERN_API( void )
  971. Exp1to3                            (const void *            inBuffer,
  972.                                  void *                    outBuffer,
  973.                                  unsigned long             cnt,
  974.                                  StateBlockPtr             inState,
  975.                                  StateBlockPtr             outState,
  976.                                  unsigned long             numChannels,
  977.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0008, 0x0010, 0xA800);
  978.  
  979. EXTERN_API( void )
  980. Comp6to1                        (const void *            inBuffer,
  981.                                  void *                    outBuffer,
  982.                                  unsigned long             cnt,
  983.                                  StateBlockPtr             inState,
  984.                                  StateBlockPtr             outState,
  985.                                  unsigned long             numChannels,
  986.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x000C, 0x0010, 0xA800);
  987.  
  988. EXTERN_API( void )
  989. Exp1to6                            (const void *            inBuffer,
  990.                                  void *                    outBuffer,
  991.                                  unsigned long             cnt,
  992.                                  StateBlockPtr             inState,
  993.                                  StateBlockPtr             outState,
  994.                                  unsigned long             numChannels,
  995.                                  unsigned long             whichChannel)                        FOURWORDINLINE(0x203C, 0x0010, 0x0010, 0xA800);
  996.  
  997. /* Sound Manager 3.0 and later calls */
  998. EXTERN_API( OSErr )
  999. GetSysBeepVolume                (long *                    level)                                FOURWORDINLINE(0x203C, 0x0224, 0x0018, 0xA800);
  1000.  
  1001. EXTERN_API( OSErr )
  1002. SetSysBeepVolume                (long                     level)                                FOURWORDINLINE(0x203C, 0x0228, 0x0018, 0xA800);
  1003.  
  1004. EXTERN_API( OSErr )
  1005. GetDefaultOutputVolume            (long *                    level)                                FOURWORDINLINE(0x203C, 0x022C, 0x0018, 0xA800);
  1006.  
  1007. EXTERN_API( OSErr )
  1008. SetDefaultOutputVolume            (long                     level)                                FOURWORDINLINE(0x203C, 0x0230, 0x0018, 0xA800);
  1009.  
  1010. EXTERN_API( OSErr )
  1011. GetSoundHeaderOffset            (SndListHandle             sndHandle,
  1012.                                  long *                    offset)                                FOURWORDINLINE(0x203C, 0x0404, 0x0018, 0xA800);
  1013.  
  1014. EXTERN_API( UnsignedFixed )
  1015. UnsignedFixedMulDiv                (UnsignedFixed             value,
  1016.                                  UnsignedFixed             multiplier,
  1017.                                  UnsignedFixed             divisor)                            FOURWORDINLINE(0x203C, 0x060C, 0x0018, 0xA800);
  1018.  
  1019. EXTERN_API( OSErr )
  1020. GetCompressionInfo                (short                     compressionID,
  1021.                                  OSType                 format,
  1022.                                  short                     numChannels,
  1023.                                  short                     sampleSize,
  1024.                                  CompressionInfoPtr     cp)                                    FOURWORDINLINE(0x203C, 0x0710, 0x0018, 0xA800);
  1025.  
  1026. EXTERN_API( OSErr )
  1027. SetSoundPreference                (OSType                 theType,
  1028.                                  Str255                 name,
  1029.                                  Handle                 settings)                            FOURWORDINLINE(0x203C, 0x0634, 0x0018, 0xA800);
  1030.  
  1031. EXTERN_API( OSErr )
  1032. GetSoundPreference                (OSType                 theType,
  1033.                                  Str255                 name,
  1034.                                  Handle                 settings)                            FOURWORDINLINE(0x203C, 0x0638, 0x0018, 0xA800);
  1035.  
  1036. EXTERN_API( OSErr )
  1037. OpenMixerSoundComponent            (SoundComponentDataPtr     outputDescription,
  1038.                                  long                     outputFlags,
  1039.                                  ComponentInstance *    mixerComponent)                        FOURWORDINLINE(0x203C, 0x0614, 0x0018, 0xA800);
  1040.  
  1041. EXTERN_API( OSErr )
  1042. CloseMixerSoundComponent        (ComponentInstance         ci)                                    FOURWORDINLINE(0x203C, 0x0218, 0x0018, 0xA800);
  1043.  
  1044. /* Sound Manager 3.1 and later calls */
  1045. EXTERN_API( OSErr )
  1046. SndGetInfo                        (SndChannelPtr             chan,
  1047.                                  OSType                 selector,
  1048.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x063C, 0x0018, 0xA800);
  1049.  
  1050. EXTERN_API( OSErr )
  1051. SndSetInfo                        (SndChannelPtr             chan,
  1052.                                  OSType                 selector,
  1053.                                  const void *            infoPtr)                            FOURWORDINLINE(0x203C, 0x0640, 0x0018, 0xA800);
  1054.  
  1055. EXTERN_API( OSErr )
  1056. GetSoundOutputInfo                (Component                 outputDevice,
  1057.                                  OSType                 selector,
  1058.                                  void *                    infoPtr)                            FOURWORDINLINE(0x203C, 0x0644, 0x0018, 0xA800);
  1059.  
  1060. EXTERN_API( OSErr )
  1061. SetSoundOutputInfo                (Component                 outputDevice,
  1062.                                  OSType                 selector,
  1063.                                  const void *            infoPtr)                            FOURWORDINLINE(0x203C, 0x0648, 0x0018, 0xA800);
  1064.  
  1065. /* Sound Manager 3.2 and later calls */
  1066. EXTERN_API( OSErr )
  1067. GetCompressionName                (OSType                 compressionType,
  1068.                                  Str255                 compressionName)                    FOURWORDINLINE(0x203C, 0x044C, 0x0018, 0xA800);
  1069.  
  1070. EXTERN_API( OSErr )
  1071. SoundConverterOpen                (const SoundComponentData * inputFormat,
  1072.                                  const SoundComponentData * outputFormat,
  1073.                                  SoundConverter *        sc)                                    FOURWORDINLINE(0x203C, 0x0650, 0x0018, 0xA800);
  1074.  
  1075. EXTERN_API( OSErr )
  1076. SoundConverterClose                (SoundConverter         sc)                                    FOURWORDINLINE(0x203C, 0x0254, 0x0018, 0xA800);
  1077.  
  1078. EXTERN_API( OSErr )
  1079. SoundConverterGetBufferSizes    (SoundConverter         sc,
  1080.                                  unsigned long             inputBytesTarget,
  1081.                                  unsigned long *        inputFrames,
  1082.                                  unsigned long *        inputBytes,
  1083.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0A58, 0x0018, 0xA800);
  1084.  
  1085. EXTERN_API( OSErr )
  1086. SoundConverterBeginConversion    (SoundConverter         sc)                                    FOURWORDINLINE(0x203C, 0x025C, 0x0018, 0xA800);
  1087.  
  1088. EXTERN_API( OSErr )
  1089. SoundConverterConvertBuffer        (SoundConverter         sc,
  1090.                                  const void *            inputPtr,
  1091.                                  unsigned long             inputFrames,
  1092.                                  void *                    outputPtr,
  1093.                                  unsigned long *        outputFrames,
  1094.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0C60, 0x0018, 0xA800);
  1095.  
  1096. EXTERN_API( OSErr )
  1097. SoundConverterEndConversion        (SoundConverter         sc,
  1098.                                  void *                    outputPtr,
  1099.                                  unsigned long *        outputFrames,
  1100.                                  unsigned long *        outputBytes)                        FOURWORDINLINE(0x203C, 0x0864, 0x0018, 0xA800);
  1101.  
  1102. /*
  1103.   Sound Component Functions
  1104.    basic sound component functions
  1105. */
  1106. EXTERN_API( ComponentResult )
  1107. SoundComponentInitOutputDevice    (ComponentInstance         ti,
  1108.                                  long                     actions)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1109.  
  1110. EXTERN_API( ComponentResult )
  1111. SoundComponentSetSource            (ComponentInstance         ti,
  1112.                                  SoundSource             sourceID,
  1113.                                  ComponentInstance         source)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  1114.  
  1115. EXTERN_API( ComponentResult )
  1116. SoundComponentGetSource            (ComponentInstance         ti,
  1117.                                  SoundSource             sourceID,
  1118.                                  ComponentInstance *    source)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  1119.  
  1120. EXTERN_API( ComponentResult )
  1121. SoundComponentGetSourceData        (ComponentInstance         ti,
  1122.                                  SoundComponentDataPtr * sourceData)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1123.  
  1124. EXTERN_API( ComponentResult )
  1125. SoundComponentSetOutput            (ComponentInstance         ti,
  1126.                                  SoundComponentDataPtr     requested,
  1127.                                  SoundComponentDataPtr * actual)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0005, 0x7000, 0xA82A);
  1128.  
  1129. /* junction methods for the mixer, must be called at non-interrupt level*/
  1130. EXTERN_API( ComponentResult )
  1131. SoundComponentAddSource            (ComponentInstance         ti,
  1132.                                  SoundSource *            sourceID)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0101, 0x7000, 0xA82A);
  1133.  
  1134. EXTERN_API( ComponentResult )
  1135. SoundComponentRemoveSource        (ComponentInstance         ti,
  1136.                                  SoundSource             sourceID)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0102, 0x7000, 0xA82A);
  1137.  
  1138. /* info methods*/
  1139. EXTERN_API( ComponentResult )
  1140. SoundComponentGetInfo            (ComponentInstance         ti,
  1141.                                  SoundSource             sourceID,
  1142.                                  OSType                 selector,
  1143.                                  void *                    infoPtr)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0103, 0x7000, 0xA82A);
  1144.  
  1145. EXTERN_API( ComponentResult )
  1146. SoundComponentSetInfo            (ComponentInstance         ti,
  1147.                                  SoundSource             sourceID,
  1148.                                  OSType                 selector,
  1149.                                  void *                    infoPtr)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0104, 0x7000, 0xA82A);
  1150.  
  1151. /* control methods*/
  1152. EXTERN_API( ComponentResult )
  1153. SoundComponentStartSource        (ComponentInstance         ti,
  1154.                                  short                     count,
  1155.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0105, 0x7000, 0xA82A);
  1156.  
  1157. EXTERN_API( ComponentResult )
  1158. SoundComponentStopSource        (ComponentInstance         ti,
  1159.                                  short                     count,
  1160.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0106, 0x7000, 0xA82A);
  1161.  
  1162. EXTERN_API( ComponentResult )
  1163. SoundComponentPauseSource        (ComponentInstance         ti,
  1164.                                  short                     count,
  1165.                                  SoundSource *            sources)                            FIVEWORDINLINE(0x2F3C, 0x0006, 0x0107, 0x7000, 0xA82A);
  1166.  
  1167. EXTERN_API( ComponentResult )
  1168. SoundComponentPlaySourceBuffer    (ComponentInstance         ti,
  1169.                                  SoundSource             sourceID,
  1170.                                  SoundParamBlockPtr     pb,
  1171.                                  long                     actions)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0108, 0x7000, 0xA82A);
  1172.  
  1173. /*Audio Components*/
  1174. /*Volume is described as a value between 0 and 1, with 0 indicating minimum
  1175.   volume and 1 indicating maximum volume; if the device doesn't support
  1176.   software control of volume, then a value of unimpErr is returned, indicating
  1177.   that these functions are not supported by the device*/
  1178. EXTERN_API( ComponentResult )
  1179. AudioGetVolume                    (ComponentInstance         ac,
  1180.                                  short                     whichChannel,
  1181.                                  ShortFixed *            volume)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0000, 0x7000, 0xA82A);
  1182.  
  1183. EXTERN_API( ComponentResult )
  1184. AudioSetVolume                    (ComponentInstance         ac,
  1185.                                  short                     whichChannel,
  1186.                                  ShortFixed             volume)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1187.  
  1188. /*If the device doesn't support software control of mute, then a value of unimpErr is
  1189. returned, indicating that these functions are not supported by the device.*/
  1190. EXTERN_API( ComponentResult )
  1191. AudioGetMute                    (ComponentInstance         ac,
  1192.                                  short                     whichChannel,
  1193.                                  short *                mute)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0002, 0x7000, 0xA82A);
  1194.  
  1195. EXTERN_API( ComponentResult )
  1196. AudioSetMute                    (ComponentInstance         ac,
  1197.                                  short                     whichChannel,
  1198.                                  short                     mute)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0003, 0x7000, 0xA82A);
  1199.  
  1200. /*AudioSetToDefaults causes the associated device to reset its volume and mute values
  1201. (and perhaps other characteristics, e.g. attenuation) to "factory default" settings*/
  1202. EXTERN_API( ComponentResult )
  1203. AudioSetToDefaults                (ComponentInstance         ac)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0004, 0x7000, 0xA82A);
  1204.  
  1205. /*This routine is required; it must be implemented by all audio components*/
  1206.  
  1207. EXTERN_API( ComponentResult )
  1208. AudioGetInfo                    (ComponentInstance         ac,
  1209.                                  AudioInfoPtr             info)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1210.  
  1211. EXTERN_API( ComponentResult )
  1212. AudioGetBass                    (ComponentInstance         ac,
  1213.                                  short                     whichChannel,
  1214.                                  short *                bass)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0006, 0x7000, 0xA82A);
  1215.  
  1216. EXTERN_API( ComponentResult )
  1217. AudioSetBass                    (ComponentInstance         ac,
  1218.                                  short                     whichChannel,
  1219.                                  short                     bass)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1220.  
  1221. EXTERN_API( ComponentResult )
  1222. AudioGetTreble                    (ComponentInstance         ac,
  1223.                                  short                     whichChannel,
  1224.                                  short *                Treble)                                FIVEWORDINLINE(0x2F3C, 0x0006, 0x0008, 0x7000, 0xA82A);
  1225.  
  1226. EXTERN_API( ComponentResult )
  1227. AudioSetTreble                    (ComponentInstance         ac,
  1228.                                  short                     whichChannel,
  1229.                                  short                     Treble)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0009, 0x7000, 0xA82A);
  1230.  
  1231. EXTERN_API( ComponentResult )
  1232. AudioGetOutputDevice            (ComponentInstance         ac,
  1233.                                  Component *            outputDevice)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x000A, 0x7000, 0xA82A);
  1234.  
  1235.  
  1236.  
  1237. /*This is routine is private to the AudioVision component.  It enables the watching of the mute key.*/
  1238. EXTERN_API( ComponentResult )
  1239. AudioMuteOnEvent                (ComponentInstance         ac,
  1240.                                  short                     muteOnEvent)                        FIVEWORDINLINE(0x2F3C, 0x0002, 0x0081, 0x7000, 0xA82A);
  1241.  
  1242.  
  1243.  
  1244. /* Sound Input Manager routines */
  1245. EXTERN_API( NumVersion )
  1246. SPBVersion                        (void)                                                        FOURWORDINLINE(0x203C, 0x0000, 0x0014, 0xA800);
  1247.  
  1248. EXTERN_API( OSErr )
  1249. SndRecord                        (ModalFilterUPP         filterProc,
  1250.                                  Point                     corner,
  1251.                                  OSType                 quality,
  1252.                                  SndListHandle *        sndHandle)                            FOURWORDINLINE(0x203C, 0x0804, 0x0014, 0xA800);
  1253.  
  1254. EXTERN_API( OSErr )
  1255. SndRecordToFile                    (ModalFilterUPP         filterProc,
  1256.                                  Point                     corner,
  1257.                                  OSType                 quality,
  1258.                                  short                     fRefNum)                            FOURWORDINLINE(0x203C, 0x0708, 0x0014, 0xA800);
  1259.  
  1260. EXTERN_API( OSErr )
  1261. SPBSignInDevice                    (short                     deviceRefNum,
  1262.                                  ConstStr255Param         deviceName)                            FOURWORDINLINE(0x203C, 0x030C, 0x0014, 0xA800);
  1263.  
  1264. EXTERN_API( OSErr )
  1265. SPBSignOutDevice                (short                     deviceRefNum)                        FOURWORDINLINE(0x203C, 0x0110, 0x0014, 0xA800);
  1266.  
  1267. EXTERN_API( OSErr )
  1268. SPBGetIndexedDevice                (short                     count,
  1269.                                  Str255                 deviceName,
  1270.                                  Handle *                deviceIconHandle)                    FOURWORDINLINE(0x203C, 0x0514, 0x0014, 0xA800);
  1271.  
  1272. EXTERN_API( OSErr )
  1273. SPBOpenDevice                    (ConstStr255Param         deviceName,
  1274.                                  short                     permission,
  1275.                                  long *                    inRefNum)                            FOURWORDINLINE(0x203C, 0x0518, 0x0014, 0xA800);
  1276.  
  1277. EXTERN_API( OSErr )
  1278. SPBCloseDevice                    (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x021C, 0x0014, 0xA800);
  1279.  
  1280. EXTERN_API( OSErr )
  1281. SPBRecord                        (SPBPtr                 inParamPtr,
  1282.                                  Boolean                 asynchFlag)                            FOURWORDINLINE(0x203C, 0x0320, 0x0014, 0xA800);
  1283.  
  1284. EXTERN_API( OSErr )
  1285. SPBRecordToFile                    (short                     fRefNum,
  1286.                                  SPBPtr                 inParamPtr,
  1287.                                  Boolean                 asynchFlag)                            FOURWORDINLINE(0x203C, 0x0424, 0x0014, 0xA800);
  1288.  
  1289. EXTERN_API( OSErr )
  1290. SPBPauseRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x0228, 0x0014, 0xA800);
  1291.  
  1292. EXTERN_API( OSErr )
  1293. SPBResumeRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x022C, 0x0014, 0xA800);
  1294.  
  1295. EXTERN_API( OSErr )
  1296. SPBStopRecording                (long                     inRefNum)                            FOURWORDINLINE(0x203C, 0x0230, 0x0014, 0xA800);
  1297.  
  1298. EXTERN_API( OSErr )
  1299. SPBGetRecordingStatus            (long                     inRefNum,
  1300.                                  short *                recordingStatus,
  1301.                                  short *                meterLevel,
  1302.                                  unsigned long *        totalSamplesToRecord,
  1303.                                  unsigned long *        numberOfSamplesRecorded,
  1304.                                  unsigned long *        totalMsecsToRecord,
  1305.                                  unsigned long *        numberOfMsecsRecorded)                FOURWORDINLINE(0x203C, 0x0E34, 0x0014, 0xA800);
  1306.  
  1307. EXTERN_API( OSErr )
  1308. SPBGetDeviceInfo                (long                     inRefNum,
  1309.                                  OSType                 infoType,
  1310.                                  void *                    infoData)                            FOURWORDINLINE(0x203C, 0x0638, 0x0014, 0xA800);
  1311.  
  1312. EXTERN_API( OSErr )
  1313. SPBSetDeviceInfo                (long                     inRefNum,
  1314.                                  OSType                 infoType,
  1315.                                  void *                    infoData)                            FOURWORDINLINE(0x203C, 0x063C, 0x0014, 0xA800);
  1316.  
  1317. EXTERN_API( OSErr )
  1318. SPBMillisecondsToBytes            (long                     inRefNum,
  1319.                                  long *                    milliseconds)                        FOURWORDINLINE(0x203C, 0x0440, 0x0014, 0xA800);
  1320.  
  1321. EXTERN_API( OSErr )
  1322. SPBBytesToMilliseconds            (long                     inRefNum,
  1323.                                  long *                    byteCount)                            FOURWORDINLINE(0x203C, 0x0444, 0x0014, 0xA800);
  1324.  
  1325. EXTERN_API( OSErr )
  1326. SetupSndHeader                    (SndListHandle             sndHandle,
  1327.                                  short                     numChannels,
  1328.                                  UnsignedFixed             sampleRate,
  1329.                                  short                     sampleSize,
  1330.                                  OSType                 compressionType,
  1331.                                  short                     baseNote,
  1332.                                  unsigned long             numBytes,
  1333.                                  short *                headerLen)                            FOURWORDINLINE(0x203C, 0x0D48, 0x0014, 0xA800);
  1334.  
  1335. EXTERN_API( OSErr )
  1336. SetupAIFFHeader                    (short                     fRefNum,
  1337.                                  short                     numChannels,
  1338.                                  UnsignedFixed             sampleRate,
  1339.                                  short                     sampleSize,
  1340.                                  OSType                 compressionType,
  1341.                                  unsigned long             numBytes,
  1342.                                  unsigned long             numFrames)                            FOURWORDINLINE(0x203C, 0x0B4C, 0x0014, 0xA800);
  1343.  
  1344. /* Sound Input Manager 1.1 and later calls */
  1345. EXTERN_API( OSErr )
  1346. ParseAIFFHeader                    (short                     fRefNum,
  1347.                                  SoundComponentData *    sndInfo,
  1348.                                  unsigned long *        numFrames,
  1349.                                  unsigned long *        dataOffset)                            FOURWORDINLINE(0x203C, 0x0758, 0x0014, 0xA800);
  1350.  
  1351. EXTERN_API( OSErr )
  1352. ParseSndHeader                    (SndListHandle             sndHandle,
  1353.                                  SoundComponentData *    sndInfo,
  1354.                                  unsigned long *        numFrames,
  1355.                                  unsigned long *        dataOffset)                            FOURWORDINLINE(0x203C, 0x085C, 0x0014, 0xA800);
  1356.  
  1357. enum { uppSndCallBackProcInfo = 0x000003C0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1358. enum { uppSndDoubleBackProcInfo = 0x000003C0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1359. enum { uppSoundParamProcInfo = 0x000000D0 };                     /* pascal 1_byte Func(4_bytes) */
  1360. enum { uppSIInterruptProcInfo = 0x1C579802 };                     /* register no_return_value Func(4_bytes:A0, 4_bytes:A1, 2_bytes:D0, 4_bytes:D1) */
  1361. enum { uppFilePlayCompletionProcInfo = 0x000000C0 };             /* pascal no_return_value Func(4_bytes) */
  1362. enum { uppSICompletionProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  1363. #define NewSndCallBackProc(userRoutine)                         (SndCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndCallBackProcInfo, GetCurrentArchitecture())
  1364. #define NewSndDoubleBackProc(userRoutine)                         (SndDoubleBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSndDoubleBackProcInfo, GetCurrentArchitecture())
  1365. #define NewSoundParamProc(userRoutine)                             (SoundParamUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSoundParamProcInfo, GetCurrentArchitecture())
  1366. #define NewSIInterruptProc(userRoutine)                         (SIInterruptUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSIInterruptProcInfo, GetCurrentArchitecture())
  1367. #define NewFilePlayCompletionProc(userRoutine)                     (FilePlayCompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppFilePlayCompletionProcInfo, GetCurrentArchitecture())
  1368. #define NewSICompletionProc(userRoutine)                         (SICompletionUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSICompletionProcInfo, GetCurrentArchitecture())
  1369. #define CallSndCallBackProc(userRoutine, chan, cmd)             CALL_TWO_PARAMETER_UPP((userRoutine), uppSndCallBackProcInfo, (chan), (cmd))
  1370. #define CallSndDoubleBackProc(userRoutine, channel, doubleBufferPtr)  CALL_TWO_PARAMETER_UPP((userRoutine), uppSndDoubleBackProcInfo, (channel), (doubleBufferPtr))
  1371. #define CallSoundParamProc(userRoutine, pb)                     CALL_ONE_PARAMETER_UPP((userRoutine), uppSoundParamProcInfo, (pb))
  1372. #if TARGET_OS_MAC && TARGET_CPU_68K && !TARGET_RT_MAC_CFM
  1373.     /* CallSIInterruptProc can't be called from classic 68k without glue code */
  1374. #else
  1375.     #define CallSIInterruptProc(userRoutine, inParamPtr, dataBuffer, peakAmplitude, sampleSize)  CALL_FOUR_PARAMETER_UPP((userRoutine), uppSIInterruptProcInfo, (inParamPtr), (dataBuffer), (peakAmplitude), (sampleSize))
  1376. #endif
  1377. #define CallFilePlayCompletionProc(userRoutine, chan)             CALL_ONE_PARAMETER_UPP((userRoutine), uppFilePlayCompletionProcInfo, (chan))
  1378. #define CallSICompletionProc(userRoutine, inParamPtr)             CALL_ONE_PARAMETER_UPP((userRoutine), uppSICompletionProcInfo, (inParamPtr))
  1379.  
  1380.  
  1381.  
  1382. #if PRAGMA_STRUCT_ALIGN
  1383.     #pragma options align=reset
  1384. #elif PRAGMA_STRUCT_PACKPUSH
  1385.     #pragma pack(pop)
  1386. #elif PRAGMA_STRUCT_PACK
  1387.     #pragma pack()
  1388. #endif
  1389.  
  1390. #ifdef PRAGMA_IMPORT_OFF
  1391. #pragma import off
  1392. #elif PRAGMA_IMPORT
  1393. #pragma import reset
  1394. #endif
  1395.  
  1396. #ifdef __cplusplus
  1397. }
  1398. #endif
  1399.  
  1400. #endif /* __SOUND__ */
  1401.  
  1402.